//
//  WYJBaseTableViewController.swift
//  MySinaWeibo
//
//  Created by eastriver on 16/10/4.
//  Copyright © 2016年 believewilliam. All rights reserved.
//

import UIKit

class WYJBaseTableViewController: UITableViewController, WYJVisitorLoginViewDelegate {
    
    var userLogin: Bool = WYJUserAccountViewModel.sharedAccountViewModel.userLogin
    lazy var visitorView: WYJVisitorLoginView = WYJVisitorLoginView()
    // 设置根视图
    override func loadView() {
        if userLogin {
            super.loadView()
        } else {
            
            //            visitorView.backgroundColor = UIColor.red
            self.view = visitorView
            visitorView.delegate = self
        }
    }
    // 实现协议方法
    func userWillLogin() {
        let oAuthVC = WYJOAuthViewController()
        let nav = UINavigationController(rootViewController: oAuthVC)
        present(nav, animated: true, completion: nil)
        
    }
    func userWillRegister() {
        print("register")
        print("~~~~~~~~~~~~~~~~~~~~~~")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    // MARK: - Table view data source
    
    override func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 0
    }
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return 0
    }
    
    
    
}
